package inabit.compiler.lexical;


/**Represents a token with a token class, position and optionally a value if it isn't univoque*/
/**@author Rafael Rocha*/
public class Token {
	private TokenClass tkClass;
	private String value;
	private int line;
	private int column;
	
	public Token(TokenClass tkClass, int line, int column) {
		this.tkClass = tkClass;
		this.line = line;
		this.column = column;
	}
	
	public void setValue(String value) {
		this.value = value;
	}
	
	public int getLine() {
		return this.line;
	}
	public int getColumn() {
		return this.column;
	}
	public String getValue() {
		return this.value;
	}
	public TokenClass getTokenClass() {
		return this.tkClass;
	}
	@Override
	public String toString() {
		return getValue() + " : " + getTokenClass() + " [ " + getLine() + ", " + getColumn() + " ]";
	}
}
